package com.sky.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 尹稳健~
 * @version 1.0
 * @time 2022/11/17
 */
@Configuration
public class RedissonConfig {
    @Bean
    public RedissonClient redissonClient(){
        // 添加redis配置
        Config config = new Config();
//        config.useSingleServer().setAddress("redis://localhost:6379");
        config.useSingleServer().setAddress("redis://47.120.3.30:6387").setPassword("Abc123");
        // 创建RedissonClient对象
        return Redisson.create(config);
    }
}
